from flask import Flask
from flask import request
import getpage

app = Flask(__name__)
@app.route('/')
def hello_world():
    return  '<form id="form" name="f" action="/s" class="fm">' \
            '<input id="kw" name="wd" class="s_ipt" value="" maxlength="255" autocomplete="off">' \
            '<input id="su" value="百度一下" class="bg s_btn" type="submit">' \
            '</form>'
@app.route('/s')
def search():
    searchword = request.args.get('wd')
    r=getpage.get_page(searchword)
    return r


if __name__ == '__main__':
    app.run()